<template>
	<view>
		<view class="tabs flex">
			<view class="flex-center" :class="{active:tabIndex == 0}" @click="changeTab(0)">开发票</view>
			<view class="flex-center" :class="{active:tabIndex == 1}" @click="changeTab(1)">已申请</view>
			<view class="flex-center" :class="{active:tabIndex == 2}" @click="changeTab(2)">已开通</view>
		</view>
		<view class="tab1 flex-between" v-if="tabIndex == 0">
			<view class="flex-center" :class="{active:tab1Index == 0 }" @click="changeTab1(0)">自营</view>
			<view class="flex-center" :class="{active:tab1Index == 1 }" @click="changeTab1(1)">第三方</view>
		</view>
		
		 <view class="empty flex-center">暂无数据</view>
	</view>
</template>

<script>

	export default {
		data() {
			return {
				tabIndex:0,
				tab1Index:0
			};
		},
		methods:{
			changeTab(index){
				this.tabIndex = index
			},
			changeTab1(index){
				this.tab1Index = index
			}
		},
		onNavigationBarButtonTap(){
			uni.navigateTo({
				url:"/pages/user/addInvoice"
			})
		}
		
	}
</script>

<style lang="less">
	@main-color:#039702;
	.tabs{
		position: fixed;
		top: 0;
		width: 100vw;
		background: white;
		padding: 0 30rpx;
		view{
			width: calc(100% / 3);
			height: 70rpx;
			font-size: 30rpx;
			color:#999;
			&.active{
				color:@main-color;
				position: relative;
				&::after{
					content:"";
					display: block;
					width: 60rpx;
					height: 4rpx;
					position: absolute;
					bottom:0;
					background: @main-color;
					left:calc(50% - 30rpx);
				}
			}
		}
	}
	.tab1{
		position: fixed;
		top:70rpx;
		width: 100vw;
		padding: 20rpx 30rpx;
		background: white;
		view{
			width: 48%;
			height: 60rpx;
			font-size: 28rpx;
			border:2rpx solid #666;
			color:#666;
			border-radius: 30rpx;
			&.active{
				color:@main-color;
				border-color: @main-color;
			}
		}
	}
	.empty{
		min-height: 60vh;
		font-size: 30rpx;
		color:#666;
	}
</style>
